const state = {
    userInfo: (localStorage.getItem("loginData") && JSON.parse(localStorage.getItem("loginData"))) || {},
    token: localStorage.getItem("token") || ''
}

const mutations = {
    setUserInfo(state, uInfo) {
        state.userInfo = uInfo;
    },
    setToken(state, token) {
        state.token = token;
    }
}

export default {
    namespaced: true, // 确保模块是命名空间
    state,
    mutations
}
